Open
Conversation
This commit adds the ability to view pipeline logs (build jobs) via the bns CLI. Features: - New `bns pipeline logs` command to fetch and display workflow job logs - Support for multiple output formats (stylish, json, yaml, raw) - Pagination support for large log files - Log filtering by step name (--step flag) - Tail support to show last N lines (--tail flag) - Follow mode for streaming logs (--follow flag, placeholder) - HTTP client for workflow job logs API endpoint - Four formatters: stylish (colored), json, yaml, and raw Technical details: - New API client in pkg/api/workflow_job/logs.go - Supports pagination with automatic page fetching - Graceful error handling with user-friendly messages - Formatters in pkg/formatter/pipeline_logs/ Usage: bns pipeline logs <environment-id> [flags] Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add workflow job discovery via External API /v1/workflows endpoint - Replace placeholder with full implementation in getLatestWorkflowJobForEnvironment() - Fix API path from /api/v1/workflow-jobs/ to /v1/workflow_jobs/ (External API uses underscores) - Fix authentication header from Authorization: Bearer to X-Auth-Token - Add default scheme "https" when profile.Scheme is empty - Add minimal debug output showing GET requests when --debug flag is used This allows users to run `bns pipeline logs <env-id>` without needing to specify --job flag. The CLI automatically finds the latest workflow for the environment and uses its most recent job. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
New
bns pipeline logscommand--jobflag required)--stepflag)--tailflag)--followflag)HTTP client for External API
pkg/api/workflow_job/logs.goFetchAllPages()GET /v1/workflow_jobs/{id}/logs?offset=0&limit=1000Automatic workflow job discovery
/v1/workflows?environment={id}to find latest workflow--jobflag for explicit job selectionOutput formatters
API fixes
/api/v1/workflow-jobs/→/v1/workflow_jobs/(External API convention)Authorization: Bearer→X-Auth-Tokenheaderhttpswhen profile scheme is empty--debugflagUsage